* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a2a3a, #0d1b2a);
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

.header {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(52, 152, 219, 0.2) 0%, transparent 70%);
    animation: rotate 10s linear infinite;
    z-index: 0;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #3498db, #2ecc71, #e74c3c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(52, 152, 219, 0.3);
    position: relative;
    z-index: 1;
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

#map {
    height: 65vh;
    width: 90%;
    margin: 20px auto;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.info-panel {
    max-width: 90%;
    width: 90%;
    margin: 0 auto 30px;
    padding: 25px;
    background: rgba(30, 30, 46, 0.8);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.info-panel h2 {
    color: #3498db;
    margin-bottom: 15px;
    border-bottom: 2px solid rgba(52, 152, 219, 0.5);
    padding-bottom: 10px;
    font-size: 1.8rem;
}

#earthquake-details {
    min-height: 100px;
}

.earthquake-marker {
    border: none;
    border-radius: 50%;
    background: #e74c3c;
    opacity: 0.8;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

.earthquake-marker:hover {
    opacity: 1;
    transform: scale(1.2);
    box-shadow: 0 0 20px currentColor;
}

.magnitude-popup .leaflet-popup-content-wrapper {
    border-radius: 12px;
    background: rgba(30, 30, 46, 0.95);
    color: white;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(52, 152, 219, 0.5);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.magnitude-popup .leaflet-popup-tip {
    background: rgba(30, 30, 46, 0.95);
    border: 1px solid rgba(52, 152, 219, 0.5);
}

.magnitude-info h3 {
    margin: 0 0 15px 0;
    font-size: 1.4rem;
    color: #3498db;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.magnitude-info p {
    margin: 10px 0;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
}

.magnitude-info p span:first-child {
    font-weight: bold;
    color: #3498db;
}

.magnitude-info .time {
    color: #ecf0f1;
    font-weight: bold;
}

.magnitude-info .magnitude {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    background: linear-gradient(90deg, #e74c3c, #f39c12);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 15px 0;
    text-shadow: 0 0 10px rgba(231, 76, 60, 0.3);
}

.magnitude-info .place {
    font-style: italic;
    color: #bdc3c7;
    text-align: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.loading {
    text-align: center;
    padding: 30px;
    font-size: 1.3rem;
    color: #3498db;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loading::after {
    content: "";
    width: 30px;
    height: 30px;
    border: 3px solid rgba(52, 152, 219, 0.3);
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-top: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    padding: 20px;
    border-radius: 10px;
    margin: 20px;
    text-align: center;
    border: 1px solid rgba(231, 76, 60, 0.5);
    backdrop-filter: blur(5px);
}

.legend {
    background: rgba(30, 30, 46, 0.9);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ecf0f1;
}

.legend h4 {
    margin: 0 0 12px;
    font-size: 1.2rem;
    color: #3498db;
    text-align: center;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 5px;
    border-radius: 5px;
    transition: background 0.3s;
}

.legend-item:hover {
    background: rgba(52, 152, 219, 0.1);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 12px;
    display: inline-block;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.legend-label {
    font-size: 0.95rem;
}

.stats-panel {
    display: flex;
    justify-content: space-around;
    margin: 15px 0;
    flex-wrap: wrap;
}

.stat-card {
    background: rgba(52, 152, 219, 0.1);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    min-width: 150px;
    margin: 10px;
    border: 1px solid rgba(52, 152, 219, 0.3);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(52, 152, 219, 0.2);
}

.stat-card h3 {
    color: #3498db;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.stat-card .value {
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(52, 152, 219, 0.5);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.8);
    animation: float 15s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px) rotate(360deg);
        opacity: 0;
    }
}